cmake_minimum_required(VERSION 3.5)

project(Previewer LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

IF (UNIX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-pthread")
ENDIF(UNIX)

if(MSVC)
	#add_compile_definitions(ASIO_STANDALONE)
	add_compile_definitions(_WEBSOCKETPP_CPP11_INTERNAL_)
	add_compile_definitions(ASIO_HAS_STD_TYPE_TRAITS)
	add_compile_definitions(ASIO_HAS_STD_SHARED_PTR)
	add_compile_definitions(ASIO_HAS_STD_ADDRESSOF)
	add_compile_definitions(ASIO_HAS_STD_ATOMIC)
	add_compile_definitions(ASIO_HAS_STD_CHRONO)
	add_compile_definitions(ASIO_HAS_CSTDINT)
	add_compile_definitions(ASIO_HAS_STD_ARRAY)
	add_compile_definitions(ASIO_HAS_STD_SYSTEM_ERROR)
endif(MSVC)

include_directories("./cxxopts")
include_directories("./asio")
include_directories("./websocketpp")
include_directories("./inc")
include_directories("./asio/include")
include_directories("./cJSON")
include_directories("./")

file(GLOB Server_SRC
    "src/*.cpp"
)

add_executable(Previewer main.cpp ${Server_SRC} cJSON/cJSON.c)

IF(MINGW)
	target_link_libraries(${CMAKE_PROJECT_NAME} libws2_32.a libmswsock.a)
ENDIF(MINGW)

